<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Receiver Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../../js/jquery.min.js" defer></script>
    <script src="../../js/jazzy.js" defer></script>
    
    <script src="../../js/lunr.min.js" defer></script>
    <script src="../../js/typeahead.jquery.js" defer></script>
    <script src="../../js/jazzy.search.js" defer></script>
  </head>
  <body>
    <a name="//apple_ref/swift/Class/Receiver" class="dashAnchor"></a>
    <a title="Receiver Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../../index.html">SwiftCoroutine 2.1.9 Docs</a> (88% documented)</p>
        <p class="header-right">
          <form role="search" action="../../search.json">
            <input type="text" placeholder="Search documentation" data-typeahead>
          </form>
        </p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../../index.html">SwiftCoroutine Reference</a>
        <img id="carat" src="../../img/carat.png" />
        Receiver Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel.html">CoChannel</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel/BufferType.html">– BufferType</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel/Receiver.html">– Receiver</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel/Sender.html">– Sender</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoFuture.html">CoFuture</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoPromise.html">CoPromise</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoScope.html">CoScope</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Enums/CoChannelError.html">CoChannelError</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Enums/CoFutureError.html">CoFutureError</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Enums/CoroutineError.html">CoroutineError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Extensions/Publisher.html">Publisher</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Extensions/URLSession.html">URLSession</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Protocols/CoCancellable.html">CoCancellable</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Protocols/CoroutineScheduler.html">CoroutineScheduler</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Structs/Coroutine.html">Coroutine</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>Receiver</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Receiver</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt"><a href="../../Classes/CoChannel.html">CoChannel</a></span><span class="o">.</span><span class="kt">Receiver</span><span class="p">:</span> <span class="kt"><a href="../../Protocols/CoCancellable.html">CoCancellable</a></span></code></pre>

                </div>
              </div>
            <p>A <code><a href="../../Classes/CoChannel.html">CoChannel</a></code> wrapper that provides receive-only functionality.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC10bufferTypeAC06BufferG0Oyx_Gvp"></a>
                    <a name="//apple_ref/swift/Property/bufferType" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC10bufferTypeAC06BufferG0Oyx_Gvp">bufferType</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The type of channel buffer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">bufferType</span><span class="p">:</span> <span class="kt"><a href="../../Classes/CoChannel/BufferType.html">BufferType</a></span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/receive"></a>
                <a name="//apple_ref/swift/Section/receive" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/receive"></a>
                  <h3 class="section-name"><p>receive</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC12awaitReceivexyKF"></a>
                    <a name="//apple_ref/swift/Method/awaitReceive()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC12awaitReceivexyKF">awaitReceive()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Retrieves and removes an element from this channel if it’s not empty,
or suspends a coroutine while the channel is empty.</p>
<div class="aside aside-throws">
    <p class="aside-title">Throws</p>
    CoChannelError when canceled or closed.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">awaitReceive</span><span class="p">()</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Element</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Removed value from the channel.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC13receiveFutureAA0cG0CyxGyF"></a>
                    <a name="//apple_ref/swift/Method/receiveFuture()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC13receiveFutureAA0cG0CyxGyF">receiveFuture()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Creates <code><a href="../../Classes/CoFuture.html">CoFuture</a></code> with retrieved value from this channel.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@inlinable</span>
<span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">receiveFuture</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt"><a href="../../Classes/CoFuture.html">CoFuture</a></span><span class="o">&lt;</span><span class="kt">Element</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code><a href="../../Classes/CoFuture.html">CoFuture</a></code> with a future value from the channel.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC4pollxSgyF"></a>
                    <a name="//apple_ref/swift/Method/poll()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC4pollxSgyF">poll()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Retrieves and removes an element from this channel.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">poll</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Element</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Element from this channel if its not empty, or returns nill if the channel is empty or is closed or canceled.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC11whenReceiveyyys6ResultOyxAA0cD5ErrorOGcF"></a>
                    <a name="//apple_ref/swift/Method/whenReceive(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC11whenReceiveyyys6ResultOyxAA0cD5ErrorOGcF">whenReceive(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Adds an observer callback to receive an element from this channel.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">whenReceive</span><span class="p">(</span><span class="n">_</span> <span class="nv">callback</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">Result</span><span class="o">&lt;</span><span class="kt">Element</span><span class="p">,</span> <span class="kt"><a href="../../Enums/CoChannelError.html">CoChannelError</a></span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>callback</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The callback that is called when a value is received.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC5countSivp"></a>
                    <a name="//apple_ref/swift/Property/count" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC5countSivp">count</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns a number of elements in this channel.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">count</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC7isEmptySbvp"></a>
                    <a name="//apple_ref/swift/Property/isEmpty" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC7isEmptySbvp">isEmpty</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns <code>true</code> if the channel is empty (contains no elements), which means no elements to receive.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isEmpty</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/map"></a>
                <a name="//apple_ref/swift/Section/map" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/map"></a>
                  <h3 class="section-name"><p>map</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC3mapyAEyqd___Gqd__xclF"></a>
                    <a name="//apple_ref/swift/Method/map(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC3mapyAEyqd___Gqd__xclF">map(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns new <code>Receiver</code> that provides transformed values from this <code><a href="../../Classes/CoChannel.html">CoChannel</a></code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="n">map</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">transform</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">Element</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">T</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../../Classes/CoChannel.html">CoChannel</a></span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;.</span><span class="kt">Receiver</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>transform</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A mapping closure.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A <code>Receiver</code> with transformed values.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/close"></a>
                <a name="//apple_ref/swift/Section/close" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/close"></a>
                  <h3 class="section-name"><p>close</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC8isClosedSbvp"></a>
                    <a name="//apple_ref/swift/Property/isClosed" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC8isClosedSbvp">isClosed</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns <code>true</code> if the channel is closed.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isClosed</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/cancel"></a>
                <a name="//apple_ref/swift/Section/cancel" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/cancel"></a>
                  <h3 class="section-name"><p>cancel</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC6cancelyyF"></a>
                    <a name="//apple_ref/swift/Method/cancel()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC6cancelyyF">cancel()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Closes the channel and removes all buffered sent elements from it.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">cancel</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC10isCanceledSbvp"></a>
                    <a name="//apple_ref/swift/Property/isCanceled" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC10isCanceledSbvp">isCanceled</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns <code>true</code> if the channel is canceled.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isCanceled</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC12whenCanceledyyyycF"></a>
                    <a name="//apple_ref/swift/Method/whenCanceled(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC12whenCanceledyyyycF">whenCanceled(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Adds an observer callback that is called when the <code><a href="../../Classes/CoChannel.html">CoChannel</a></code> is canceled.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">whenCanceled</span><span class="p">(</span><span class="n">_</span> <span class="nv">callback</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>callback</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The callback that is called when the <code><a href="../../Classes/CoChannel.html">CoChannel</a></code> is canceled.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/complete"></a>
                <a name="//apple_ref/swift/Section/complete" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/complete"></a>
                  <h3 class="section-name"><p>complete</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC12whenCompleteyyyycF"></a>
                    <a name="//apple_ref/swift/Method/whenComplete(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC12whenCompleteyyyycF">whenComplete(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Adds an observer callback that is called when the <code><a href="../../Classes/CoChannel.html">CoChannel</a></code> is completed (closed, canceled or deinited).</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">whenComplete</span><span class="p">(</span><span class="n">_</span> <span class="nv">callback</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>callback</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The callback that is called when the <code><a href="../../Classes/CoChannel.html">CoChannel</a></code> is completed.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/sequence"></a>
                <a name="//apple_ref/swift/Section/sequence" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/sequence"></a>
                  <h3 class="section-name"><p>sequence</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC12makeIterators03AnyG0VyxGyF"></a>
                    <a name="//apple_ref/swift/Method/makeIterator()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC12makeIterators03AnyG0VyxGyF">makeIterator()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Make an iterator which successively retrieves and removes values from the channel.</p>

<p>If <code>next()</code> was called inside a coroutine and there are no more elements in the channel,
then the coroutine will be suspended until a new element will be added to the channel or it will be closed or canceled.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@inlinable</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">makeIterator</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">AnyIterator</span><span class="o">&lt;</span><span class="kt">Element</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Iterator for the channel elements.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/publisher"></a>
                <a name="//apple_ref/swift/Section/publisher" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/publisher"></a>
                  <h3 class="section-name"><p>publisher</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC8ReceiverC9publisher7Combine12AnyPublisherVyxAA0cD5ErrorOGyF"></a>
                    <a name="//apple_ref/swift/Method/publisher()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC8ReceiverC9publisher7Combine12AnyPublisherVyxAA0cD5ErrorOGyF">publisher()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns a publisher that emits elements of this <code>Receiver</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">publisher</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">AnyPublisher</span><span class="o">&lt;</span><span class="kt">Element</span><span class="p">,</span> <span class="kt"><a href="../../Enums/CoChannelError.html">CoChannelError</a></span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2020 <a class="link" href="https://github.com/belozierov/SwiftCoroutine" target="_blank" rel="external">Alex Belozierov</a>. All rights reserved. (Last updated: 2020-07-11)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.5</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
